package com.alter.zhang.userprovider.controller;

import com.alibaba.fastjson.JSONObject;
import com.alter.zhang.userprovider.service.WXUserService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@Slf4j
@RefreshScope
public class Test {

    @Autowired
    private WXUserService wxUserService;

    @Value("${test:11111}")
    private String test;

    @RequestMapping("hello")
    public String hello() {
        log.info("===============test" + test);
        return JSONObject.toJSONString(wxUserService.finById(1L));
    }
}
